package com.sgxy.service.impl;

import com.sgxy.entity.JobInf;
import com.sgxy.mapper.JobInfMapper;
import com.sgxy.service.JobInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobInfServiceImpl implements JobInfService {

    private final JobInfMapper jobInfMapper;
    @Autowired
    public JobInfServiceImpl(JobInfMapper jobInfMapper) {
        this.jobInfMapper = jobInfMapper;
    }

    @Override
    public int addJobInf(JobInf jobInf) {
        int i = jobInfMapper.insertSelective(jobInf);
        return i;
    }

    @Override
    public int deleteJobInf(List<String> id) {
        int i = jobInfMapper.deleteJobInfById(id);
        return i;
    }

    @Override
    public int updateJobInf(JobInf jobInf) {
        int i = jobInfMapper.updateByPrimaryKeySelective(jobInf);
        return i;
    }

    @Override
    public JobInf queryJobInf(Integer id) {
        JobInf jobInf = jobInfMapper.selectByPrimaryKey(id);
        return jobInf;
    }

    @Override
    public List<JobInf> queryAllFJobInfs(JobInf jobInf) {
        List<JobInf> jobInfs = jobInfMapper.queryAllJobInfs(jobInf);
        return jobInfs;
    }
}
